using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AXBC = Microsoft.Dynamics.BusinessConnectorNet;
using AXMD = Microsoft.Dynamics.Framework.Metadata.Ax;
using Proxy = Microsoft.Dynamics.Framework.BusinessConnector.Proxy;

namespace DynamicsAXPS
{
    [System.Management.Automation.Cmdlet("New", "AXEDT")]
    public class New_AXEDT : System.Management.Automation.PSCmdlet
    {
        [System.Management.Automation.Parameter(Position = 0, Mandatory = true)]
        public string Name;

        protected override void ProcessRecord()
        {
            var ax = new AXBC.Axapta();
            ax.Logon(null, null, null, null);
            string method = "CreateEDTString";
            string _class = "DynamicsAXPS";
            object[] parameters = new object[] { this.Name };

            var retval = ax.CallStaticClassMethod(_class, method, parameters);
            this.WriteObject(retval);
            ax.Logoff();
        }
    }
}
